package cn.softeem.tushu.utils;

import java.util.List;

public class PageBean<T> {
    private Integer pageNow;
    private Integer pageCount;
    private Integer totalCount;
    private List<T> list;
    private String url;
//    private Integer totalPage;
//
//    public void setTotalPage(Integer totalPage) {
//        this.totalPage = totalPage;
//    }

    public Integer getTotalPage(){
        if(totalCount%pageCount == 0){
            return totalCount/pageCount;
        }else{
            return totalCount/pageCount + 1;
        }
    }

    @Override
    public String toString() {
        return "PageBean{" +
                "pageNow=" + pageNow +
                ", pageCount=" + pageCount +
                ", totalCount=" + totalCount +
                ", list=" + list +
                ", url='" + url + '\'' +
                '}';
    }

    public Integer getPageNow() {
        return pageNow;
    }

    public void setPageNow(Integer pageNow) {
        this.pageNow = pageNow;
    }

    public Integer getPageCount() {
        return pageCount;
    }

    public void setPageCount(Integer pageCount) {
        this.pageCount = pageCount;
    }

    public Integer getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(Integer totalCount) {
        this.totalCount = totalCount;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }
}
